<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/user-page.css" />
<?php
$conn = mysql_connect("localhost", "root", "123456") or die("Ket noi den MySQL that bai");
mysql_select_db("mp3", $conn);

mysql_query("SET NAMES UTF8", $conn);
$row = mysql_fetch_array($q);   
?>
<title>PlayList Của Bạn</title>
<link rel="stylesheet" type="text/css" href="css/chitiet-page.css" />
<link rel="stylesheet" type="text/css" href="engine1/style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
</head>
<?php include_once ('master_menu.php'); ?>
<div class="page">
  <div class="musicpage">
        <div class="conten-title" >
         <?php
$user = $_SESSION["login"];
$sql = "select * from playlist as p, `user` as u, music_playlist as mp, music  as m
where p.id_user=u.id_user
and mp.id_playlist=p.id_playlist
and m.id_music=mp.id_music
and u.username ='" . $user."' and limit = 1";
$q = mysql_query($sql);
while ($row = mysql_fetch_array($q)) 
{
    $tenbh=$row["tenmusic"];
    $link=$row["link"];
?>

<h1><?=$tenbh?></h1>
    <?php
}
	?>    
     

    <div class="music-flas">
        <?php if (isset($_GET["title"]))
        {
        ?>
              <embed style="width:600px; height:75px;" src="<?=$_GET["title"]?>"/>
        <?php 
        } 
        ?>    
    </div>
         <div style="height: 200px;">
            <?php 
                $sql = "select * from playlist as p, `user` as u, music_playlist as mp, music  as m
                where p.id_user=u.id_user
                and mp.id_playlist=p.id_playlist
                and m.id_music=mp.id_music
                and u.username ='" . $user. "'" . " and p.id_playlist='" . $_GET["id_pl"] . "'";
                $a = mysql_query($sql);
                while ($row= mysql_fetch_array($a))
                {
                    
                    $tenbh=$row["tenmusic"];
                    $playlist=$row["id_playlist"];
                    $link=$row["link"];
            ?>
                <h3><a href="chitietpl.php?id=<?=$playlist?>&title=nhac/<?=$link?>"><?=$tenbh?></a></h3><br />
            <?php
                }
            ?>
        </div>

<?php 


mysql_close($conn); 
?>
</div>
<?php include_once ('master_footer.php'); ?>
